package com.menggudf.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.menggudf.entity.CommonSymptom;
import com.menggudf.model.ExportIllnessModel;
import com.menggudf.model.Illness2Model;
import com.menggudf.model.IllnessModel;
import com.menggudf.model.ResultModel;
import com.menggudf.model.SymptomModel;

public interface IllnessService{

    /**
     * 获取疾病列表
     * @param author 
     * @param string 
     * */
    Map<String, Object> getIllnessList(
            String illName,
            String symptomName,
            String parts,
            String levelOneSubject,
            String levelTwoSubject,
            Date startTime,
            Date endTime,
            String diseaseAge,
            int pageSize,
            int offset);

    /**
     * 新增疾病记录
     * @param author 
     * @param isInjured 
     * @param duration 
     * @param medicine 
     * @param scheme 
     * @param pathogen 
     * */
    ResultModel createIllnessRecort(
            String illness,
            String symptoms,
            String parts,
            String specialCrowd,
            String levelOneSubject,
            String levelTwoSubject,
            String diseaseAge, 
            String author,
            String examNames,
            Boolean isInjured, 
            String duration, String pathogen, String scheme, String medicine);

    /**
     * 根据illness获取illness详情
     * @param illness
     * */
    IllnessModel getIllnessDetail(String illness);

    /**
     * 根据部位获取对应的疾病
     * @return 疾病ID的list
     * */
    Map<String, Object> getIllByparts(String parts);

    /**
     * 根据疾病id的list，获取所有的这些疾病的病症
     * */
    Map<String, Object> getSymptomsByillList(String ids);

    /**
     * 按疾病ID和症状继续查询具体病
     * 直至搜索出唯一的疾病
     * 疾病的唯一由前端控制（当疾病只剩下一种）
     * symptoms为之前已经搜索过的字段
     * @param times 
     * @param nature 
     * @param degree 
     * @param pulse 
     * @param bloodPressure 
     * @param temperature 
     * */
    Map<String, Object> getIllByIdAndsymptoms(
            String symptom, String symptoms, String ids,
            String temperature, String sYS,String dIA, String pulse, String degree, String nature, String times);

    /**
     * 根据疾病的自增ID获取对应的疾病
     * */
    IllnessModel getIllnessById(String id);

    /**
     * 当这种病症不存在
     * */
    Map<String, Object> getIllByIdAndsymptomsNo(String symptom, String symptoms, String ids);

    /**
     * 根据疾病ids获取疾病list
     * */
    List<IllnessModel> getillsByIds(String ids);

    ResultModel editIllnessRecort(
            String illness,
            String symptoms,
            String parts,
            String specialCrowd,
            String levelOneSubject,
            String levelTwoSubject,
            String diseaseAge,
            String author,
            String examNames, 
            Boolean isInjured, String duration,String pathogen, String scheme, String medicine);

    /**
     * 根据性别类型，部位，是否受伤，年龄  查询疾病
     * @param diseaseAge 
     * @param pulse 
     * @param bloodPressure 
     * @param temperature 
     * @param type 
     * */
    Map<String, Object> getIllnessInParts(
            String parts,
            int sex,
            int isInjured,
            int diseaseAge,
            String temperature,
            String sYS,
            String dIA,
            String pulse,
            int type);

    Illness2Model getIllness2ById(String id);

    ResultModel deleteIll(String illness);

    ResultModel deleteSymptom(String illness);

    ResultModel deleteParts(String illness);

    List<String> getExamByillList(String ids);

    ResultModel addIll(IllnessModel illnessModel);

    List<SymptomModel> getSymptoms(String ids, String symptom);

/*    ResultModel importExcel(MultipartFile file);*/

    Map<String, Object> getIllnessBySexAndAge(Integer sex, Integer age);

    Map<String, Object> getIllnessByIdsAndSymptom(
            String ids,
            String symptom,
            Integer value);

    Map<String, Object> getIllnessByPart(String ids, String part);

    Map<String, Object> getIllByIdAndsymptomsYes(
            String symptom,
            String symptoms,
            String ids,
            Integer value,
            String degree,
            String nature,
            String times);

    ResultModel editIllness(
            String illness,
            Integer sex,
            String levelOneSubject,
            String levelTwoSubject,
            String assistantExam,
            String duration,
            String pathogen,
            String scheme,
            String medicine);

    ResultModel editSym(
            String illness,
            String symptom,
            String degree,
            String nature,
            String times,
            String medicine,
            Double sdown,
            Double sup,
            String imgurl,
            Integer id,
            String parts,String description);

    ResultModel editPart(String illness, String part, Integer id);

    Map<String, Object> getSymptomsByPart(String ids, String part);

    ResultModel getIllByIdAndsymptomsAndPart(
            String symptom,
            String ids,
            String degree,
            String nature,
            String times,
            String imgurl,
            String part,
            String pastHistory,
            String incentive,
            String medicineHistory, 
            Integer isImportant,
            Double tp, String factor);

    List<String> getSympByLike(String symp);

    List<String> getCommonSymp();

    List<CommonSymptom> getAllCommonSymptom();

    boolean hasSymptom(String symptom);

    void deleteCommonSymptomByIds(List<Integer> ids);

    ResultModel setSymptomCommon(String symptom, String adminName);

    ResultModel setSymptomCommonNot(String symptom);

    Map<String, Object> getSymptomList(String symptom, int pageSize, int offset);

    Map<String, Object> getIllnessList(
            String illName,
            String symptomName,
            String parts,
            String levelOneSubject,
            String levelTwoSubject,
            Date startTime,
            Date endTime,
            String age,
            int pageSize,
            int offset,
            String adminCode);

    ResultModel importExcel(MultipartFile file, String adminCode);

    List<ExportIllnessModel> exportIllness(String illness);

    ResultModel synAllIllMedicines();

}
